package com.ruoyi.oss.config;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;


/**
 * OSS对象存储相关配置 Created by macro on 2018/5/17.
 */
@Configuration
public class OssConfig{

	@Value("${aliyun.oss.endpoint}")  
    private String endpoint;  
  
    @Value("${aliyun.oss.accessKeyId}")  
    private String accessKeyId;  
  
    @Value("${aliyun.oss.accessKeySecret}")  
    private String accessKeySecret;  
  
    @Value("${aliyun.oss.bucketName}")  
    private String bucketName;  
  
    @Value("${aliyun.oss.picPrefix}")  
    private String picPrefix;  
  
    @Value("${aliyun.oss.modulePrefix}")  
    private String modulePrefix;  
  
    @Value("${aliyun.oss.userPrefix}")  
    private String userPrefix;  
  
    @Value("${aliyun.oss.order}")  
    private String order;  
  
    @Value("${aliyun.oss.comment}")  
    private String comment;  
  
    @Value("${aliyun.oss.productImag}")  
    private String productImag;  
  
    @Value("${aliyun.oss.paymentApproval}")  
    private String paymentApproval;  
  
    @Value("${aliyun.oss.orderApproval}")  
    private String orderApproval;  
  
    @Value("${aliyun.oss.receivables}")  
    private String receivables;  
  
    @Value("${aliyun.oss.followPic}")  
    private String followPic;  
  
    @Value("${aliyun.oss.rootpath}")  
    private String rootpath;  
  
    @Value("${aliyun.oss.localPicURL}")  
    private String localPicURL;  
  
    @Value("${aliyun.oss.policy.expire}")  
    private long expire; // 签名有效期(S)  
  
    @Value("${aliyun.oss.maxSize}")  
    private int maxSize; // 上传文件大小(M)  
  
    // 回调地址，需要加上协议头http:// 或 https://  
    @Value("${aliyun.oss.callback}")   
    private String callback;   
    
    @Value("${aliyun.oss.areaId}")   
    private String areaId;
  
    // 上传文件大小，单位为字节，这里假设为1M，即1048576字节。根据实际需要修改。  
    @Value("${aliyun.oss.size}")   
    private int size;   
  
    // 上传文件夹路径前缀，这里假设为 market/，根据实际需要修改。  
    @Value("${aliyun.oss.dir.prefix}")   
    private String dirPrefix;
    
    
    @Value("${aliyun.oss.resource}")   
    private String resource;
    
    @Value("${aliyun.oss.example}")
    private String example;
    
    public String getExample() {
		return example;
	}

	public void setExample(String example) {
		this.example = example;
	}

	public String getResource() {
		return resource;
	}

	public void setResource(String resource) {
		this.resource = resource;
	}

	/**
     * 获取 URL
     * @return
     */
    public String getURL() {
    	return this.bucketName.concat(".").concat(this.endpoint);
    }

	public String getEndpoint() {
		return endpoint;
	}

	public void setEndpoint(String endpoint) {
		this.endpoint = endpoint;
	}

	public String getAccessKeyId() {
		return accessKeyId;
	}

	public void setAccessKeyId(String accessKeyId) {
		this.accessKeyId = accessKeyId;
	}

	public String getAccessKeySecret() {
		return accessKeySecret;
	}

	public void setAccessKeySecret(String accessKeySecret) {
		this.accessKeySecret = accessKeySecret;
	}

	public String getBucketName() {
		return bucketName;
	}

	public void setBucketName(String bucketName) {
		this.bucketName = bucketName;
	}

	public String getPicPrefix() {
		return picPrefix;
	}

	public void setPicPrefix(String picPrefix) {
		this.picPrefix = picPrefix;
	}

	public String getModulePrefix() {
		return modulePrefix;
	}

	public void setModulePrefix(String modulePrefix) {
		this.modulePrefix = modulePrefix;
	}

	public String getUserPrefix() {
		return userPrefix;
	}

	public void setUserPrefix(String userPrefix) {
		this.userPrefix = userPrefix;
	}

	public String getOrder() {
		return order;
	}

	public void setOrder(String order) {
		this.order = order;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public String getProductImag() {
		return productImag;
	}

	public void setProductImag(String productImag) {
		this.productImag = productImag;
	}

	public String getPaymentApproval() {
		return paymentApproval;
	}

	public void setPaymentApproval(String paymentApproval) {
		this.paymentApproval = paymentApproval;
	}

	public String getOrderApproval() {
		return orderApproval;
	}

	public void setOrderApproval(String orderApproval) {
		this.orderApproval = orderApproval;
	}

	public String getReceivables() {
		return receivables;
	}

	public void setReceivables(String receivables) {
		this.receivables = receivables;
	}

	public String getFollowPic() {
		return followPic;
	}

	public void setFollowPic(String followPic) {
		this.followPic = followPic;
	}

	public String getRootpath() {
		return rootpath;
	}

	public void setRootpath(String rootpath) {
		this.rootpath = rootpath;
	}

	public String getLocalPicURL() {
		return localPicURL;
	}

	public void setLocalPicURL(String localPicURL) {
		this.localPicURL = localPicURL;
	}

	public long getExpire() {
		return expire;
	}

	public void setExpire(long expire) {
		this.expire = expire;
	}

	public int getMaxSize() {
		return maxSize;
	}

	public void setMaxSize(int maxSize) {
		this.maxSize = maxSize;
	}

	public String getCallback() {
		return callback;
	}

	public void setCallback(String callback) {
		this.callback = callback;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public String getDirPrefix() {
		return dirPrefix;
	}

	public void setDirPrefix(String dirPrefix) {
		this.dirPrefix = dirPrefix;
	}

	public String getAreaId() {
		return areaId;
	}

	public void setAreaId(String areaId) {
		this.areaId = areaId;
	}   
	



	
	
}
